import api from '../index'
import config from "@/config"

export const goodsList = (params) => {
	const url = `${config.pre}/supplier-activity/goodsAdmin/list?pageNum=${params.pageNum}&pageSize=${params.pageSize}`
	return api.post(url, params)
}

export const goodsSave = (params) => {
	const url = `${config.pre}/supplier-activity/goodsAdmin/save`;
	return api.post(url, params)
}

export const goodsBatchDown = (skus, params) => {
	const url = `${config.pre}/supplier-activity/goods/DOWNALL/${skus}`;
	return api.get(url, params)
}

export const goodsDown = (params) => {
	const url = `${config.pre}/supplier-activity/goods/DOWN`;
	return api.post(url, params)
}
// 商品类型id获取属性列表
export const getItemPropertyListApi = (params) => {
	const url = `${config.pre}/supplier-activity/property/list?pageNum=${params.pageNum}&pageSize=${params.pageSize}`
	return api.post(url, params)
}
// 根据类型查询字典数据
export const getDictionaryListByType = (type) => {
	const url = `${config.pre}/supplier-activity/dictionary/list/${type}`;
	return api.get(url);
}

// 根据列表上架商品
export const passAllByList = (list) => {
	const url = `${config.pre}/supplier-activity/goods/PASSALL/list`;
	return api.post(url, list);
}